﻿//
// © Algobox Ltd - Benn Eichhorn
//
using System;
using Algobox.Objects.Finance.Assets.Stock;

namespace Algobox.Structure.Finance.Strategies
{
    public class Strategy
    {
        public Strategy(StockSecurity security)
        {
            _security = security;
            _strategyId = System.Threading.Interlocked.Increment(ref _strategyIdCounter);
            _strategyIdString = "StrategyId(" + _strategyId + ")";
        }

        public Strategy(StockSecurity securityA, StockSecurity securityB)
        {
            _security = securityA;
            _securityPair = securityB;
            _strategyId = System.Threading.Interlocked.Increment(ref _strategyIdCounter);
            _strategyIdString = "StrategyId(" + _strategyId + ")";
        }

        static int _strategyIdCounter;

        protected readonly int _strategyId;
        protected readonly string _strategyIdString;
        protected StockSecurity _security;
        protected StockSecurity _securityPair;

        public StockSecurity Security { get { return _security; } }
        public StockSecurity SecurityPair { get { return _securityPair; } }
        public string Id { get { return _strategyIdString; } }
        public int StrategyId { get { return _strategyId; } }
    }
}
